Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

cids

Package Overview
Dependencies
Maintainers
3
Versions
44
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cids

CID Implementation in JavaScript

  • 0.8.3
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
416K
increased by21.29%
Maintainers
3
Weekly downloads
 
Created

What is cids?

The 'cids' npm package is used for handling Content Identifiers (CIDs) in the context of IPFS (InterPlanetary File System). CIDs are a fundamental part of IPFS, allowing for unique identification of content based on its cryptographic hash. This package provides utilities for creating, parsing, and working with CIDs.

What are cids's main functionalities?

Creating a CID

This feature allows you to create a new CID instance. The constructor takes the version, codec, and multihash as parameters. The example demonstrates creating a CID of version 1 with the 'dag-pb' codec.

const CID = require('cids');
const cid = new CID(1, 'dag-pb', Buffer.from('1220...'));
console.log(cid.toString());

Parsing a CID

This feature allows you to parse an existing CID string. The example shows how to parse a CID and access its version property.

const CID = require('cids');
const cid = new CID('Qm...');
console.log(cid.version);

Converting CID to different formats

This feature allows you to convert a CID to different versions. The example demonstrates converting a CID to version 1 and then converting it to a string.

const CID = require('cids');
const cid = new CID('Qm...');
console.log(cid.toV1().toString());

Other packages similar to cids

Keywords

FAQs

Package last updated on 19 Jun 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc